<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.org/ui"
                xmlns:f="http://java.sun.com/jsf/core">
    <p:panel id="pnl" header="Cadastro de Paciente" style="width:100%">

        <h:panelGrid columns="6">
            <p:outputLabel  value="Código:"/>
            <p:inputText  id="id"  value="#{pacienteMb.p3.id}"  required="true"/>
            <p:message for="id" id="msgId" />

            <p:outputLabel   value="Nome:"/>
            <p:inputText  id="nom"  value="#{pacienteMb.pessoa5.nome}"  required="true"/>
            <p:message for="nom" id="msgnom" />


            <p:outputLabel  value="Nome do Pai:"/>
            <p:inputText  id="pai"  value="#{pacienteMb.p3.nomePai}"  required="true"/>
            <p:message for="pai" id="msgpai" />


            <p:outputLabel  value="Nome do Mãe:"/>
            <p:inputText  id="mae"  value="#{pacienteMb.p3.nomeMae}"  required="true"/>
            <p:message for="mae" id="msgmae" />


            <p:outputLabel  value="CPF:"/>
            <p:inputText  id="cpf"  value="#{pacienteMb.p3.cpf}"  required="true"/>
            <p:message  for="cpf" id="msgCpf" />


            <p:outputLabel  value="CNS:"/>
            <p:inputText  id="cns"  value="#{pacienteMb.p3.cns}"  required="true"/>
            <p:message for="id" id="msgCns" />


            <p:outputLabel  value="Data de Nascimento:"/>
            <p:calendar navigator="true"  id="dt"  value="#{pacienteMb.p3.dataNascimento}"  required="true"/>   
            <p:message for="dt" id="msgdt" />
            <h:outputText value="Telefone:"/>
            <p:inputText   id="decri" value="#{pacienteMb.pessoa5.telefone}"  required="true"/>
            <p:message for="decri" id="msgDecri"/>
            <h:outputText value="Cidade:"/>
            <p:inputText   id="cid" value="#{pacienteMb.cidade.nome}"  required="true"/>
            <p:message for="cid" id="msgCid"/>
            <h:outputText value="CEP:"/>
            <p:inputText   id="cep" value="#{pacienteMb.endereco.cep}"  required="true">
               
            </p:inputText>
            <p:message for="cep" id="msgCep"/>

            <h:outputText value="Observações:"/>
            <p:inputTextarea   id="obs" value="#{pacienteMb.p3.observacao}"  required="true"/>
            <p:message for="obs" id="msgobs"/>

            <p:outputLabel  value="Sexo:"/>
            <p:selectOneRadio id="sx" value="#{pacienteMb.p3.sexo}" required="true">
                <f:selectItem itemValue="M" itemLabel="M"/>
                <f:selectItem itemValue="F" itemLabel="F"/>
            </p:selectOneRadio>
            <p:message for="sx" id="msgSx" />
            <p:outputLabel  value="Estado Civil:"/>
            <p:selectOneMenu id="esc" value="#{pacienteMb.estadoCivil}" required="true">
                <f:selectItem itemValue="#{pacienteMb.casado}" itemLabel="Casado"/>
                <f:selectItem itemValue="#{pacienteMb.separado}" itemLabel="Separado"/>
                <f:selectItem itemValue="#{pacienteMb.solteiro}" itemLabel="Solteiro"/>
            
            </p:selectOneMenu>
            <p:message for="esc" id="msgEsc" />

            <p:outputLabel  value="Raça\\Cor:"/>
            <p:selectOneMenu id="rac" value="#{pacienteMb.raca.descricao}" required="true">
                <f:selectItem itemValue="Mulato" itemLabel="Mulato"/>
                <f:selectItem itemValue="Pardo" itemLabel="Pardo"/>
                 <f:selectItem itemValue="Negro" itemLabel="Negro"/>
                  <f:selectItem itemValue="Branco" itemLabel="Branco"/>
            </p:selectOneMenu>
            <p:message for="rac" id="msgrac" />



        </h:panelGrid>
        <h:panelGrid columns="2" cellspacing="30" cellpadding="10">
            <p:commandButton icon="ui-icon-arrowrefresh-1-e" immediate="true" ajax="false" type="reset" action="#{pacienteMb.limpar()}"   value="Limpar"/>
            <p:commandButton icon="ui-icon-disk" action="#{pacienteMb.salvar() }" update="pnl,msgDecri,msgnom,msgCns" value="Salvar"/>
        </h:panelGrid>
    </p:panel>

</ui:composition>

